Skip to content

bch(g3): --testnet4 net-params path -- magic e2b7daaf + own-genesis selector - #615

Merged
frstrtr merged 1 commit into
masterfrom
bch/testnet4-magic-path
Jul 3, 2026
Merged

bch(g3): --testnet4 net-params path -- magic e2b7daaf + own-genesis selector#615
frstrtr merged 1 commit into
masterfrom
bch/testnet4-magic-path

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 3, 2026

Copy link
Copy Markdown
Owner

What

Wire BCH testnet4 into the c2pool-bch --pool entrypoint so the embedded daemon selects testnet4 consensus params instead of falling back to testnet3.

Root cause (prior): run_pool had no testnet4 branch -> emitted testnet3 magic f4e5f3f4 + testnet3 genesis -> BCHN EOF-dropped the peer right after connect -> HeaderChain stuck at h0.

Hunks (3 files)

  • src/impl/bch/config_coin.hppm_testnet4 flag (testnet-class for ABLA/ASERT).
  • src/impl/bch/coin/embedded_daemon.hpp — select BCHChainParams::testnet4() (own genesis 000000001dd4.., ASERT anchor 16844) when m_testnet4.
  • src/c2pool/main_bch.cpp--testnet4 arg (port 28333); bch_magic_bytes() emits e2b7daaf (CTestNet4Params, verified vs bchn29 rodata); run_pool threads testnet4 through magic / params / banner.

testnet4() + asert_testnet4() consensus constants already live in master — this is CLI + selector wiring only.

Proof

Build GREEN (link EXIT=0). Behavioural: --pool --testnet4 vs a testnet4 BCHN substrate handshakes off h0 (start_height=312925, BCHN 29.0.0), EOF-drop gone, HeaderChain advances past h0 (2000->4000/312925 climbing).

Isolation / compat

  • Per-coin isolation intact: only src/impl/bch/ + the c2pool-bch-exclusive main_bch.cpp entrypoint. No src/core / bitcoin_family / peer-coin hunks.
  • No p2pool-merged-v36 surface change (subsidy / payout / version-gate untouched) -> surface-for-tap, not auto-merge.

Follow-up (tracked, non-consensus)

Cosmetic leveldb path + BCHWorkSource still label bitcoincash_testnet for testnet4; magic/genesis/P2P path proven correct by sync off the real testnet4 chain. Separate label-harmonization slice.

Do NOT self-merge — integrator merges on operator tap.

…elector

Wire BCH testnet4 into the c2pool-bch --pool entrypoint so the embedded
daemon selects testnet4 consensus params instead of falling back to
testnet3. Prior: run_pool had no testnet4 branch, so it emitted testnet3
magic f4e5f3f4 + testnet3 genesis; BCHN EOF-dropped the peer right after
connect and HeaderChain stuck at h0.

- config_coin.hpp: m_testnet4 flag (testnet-class for ABLA/ASERT).
- embedded_daemon.hpp: select BCHChainParams::testnet4() (own genesis
  000000001dd4.., ASERT anchor 16844) when m_testnet4.
- main_bch.cpp: --testnet4 arg (port 28333); bch_magic_bytes() emits
  e2b7daaf (CTestNet4Params, verified vs bchn29 rodata); run_pool threads
  testnet4 through magic / params / banner label.

testnet4() + asert_testnet4() consensus constants already in master; this
is CLI + selector wiring only. Behavioural proof: --pool --testnet4 vs a
testnet4 BCHN substrate handshakes off h0 (start_height=312925, BCHN
29.0.0), EOF-drop gone, HeaderChain advances past h0. No p2pool-merged-v36
surface change (subsidy / payout / version-gate untouched) -> surface-for-tap.

Per-coin isolation intact: only src/impl/bch/ plus the c2pool-bch-exclusive
main_bch.cpp entrypoint; no src/core / bitcoin_family / peer-coin hunks.

Cosmetic follow-up (tracked, non-consensus): leveldb path + BCHWorkSource
still label bitcoincash_testnet for testnet4; magic/genesis/P2P path proven
correct by sync off the real testnet4 chain.
@frstrtr
frstrtr force-pushed the bch/testnet4-magic-path branch from bf372f4 to ea739ee Compare July 3, 2026 18:48
@frstrtr
frstrtr merged commit 9bd5166 into master Jul 3, 2026
22 checks passed
frstrtr added a commit that referenced this pull request Jul 3, 2026
bch(g3): testnet4 own LevelDB sharechain namespace (stacked on #615)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant